package com.app.Lisenner;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * Created by xinjian.hu on 18-2-12.
 */
public class ActiveMqLisenner implements MessageListener {
    @Override
    public void onMessage(Message message) {
        if (message instanceof TextMessage) {
            try {
                String msg = ((TextMessage) message).getText();
                System.out.println(msg);
            } catch (JMSException e) {
                e.printStackTrace();
            }
        }
    }
}
